package edu.ccut.saturn.studio.server.model;


public class SaturnServer {
	
	public final static String[] SERVER_TYPES = new String[] { "tomcat", "jboss" };

	private String name = "";
	private String classType = "";
	private String serverPath = "";
	private String depolyPath = "";
	private String port = "8080";

	public static String getDefaultSaturnServerPath(String dir, String serverType) {
		if (dir.endsWith("/")) {
			dir = dir.substring(0, dir.length() - 1);
		}
		
		if ("tomcat".equals(serverType)) {
			return dir + "/webapps";
		} else if ("jboss".equals(serverType)){
			return dir + "/server/default/deploy";
		} else {
			return dir +"";
		}
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getClassType() {
		return classType;
	}

	public void setClassType(String classType) {
		this.classType = classType;
	}

	public String getServerPath() {
		return serverPath;
	}

	public void setServerPath(String serverPath) {
		this.serverPath = serverPath;
	}

	public String getDepolyPath() {
		return depolyPath;
	}

	public void setDepolyPath(String depolyPath) {
		this.depolyPath = depolyPath;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}
}
